home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!parkbayl.demon.co.uk
- From: Martin Bayly <martin@parkbayl.demon.co.uk>
- Newsgroups: comp.lang.c++
- Subject: [Q] Template instantiation
- Date: Fri, 01 Mar 1996 12:14:50 GMT
- Organization: Park Bayly Ltd
- Message-ID: <37116784wnr@parkbayl.demon.co.uk>
- Reply-To: martin@parkbayl.demon.co.uk
- X-NNTP-Posting-Host: parkbayl.demon.co.uk
- X-Newsreader: Newswin Alpha 0.9
- X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!parkbayl.demon.co.uk
-
- Can anyone tell me if its possible to instantiate a template with a class
- that is in itself a template.
-
- i.e. I have two classes
-
- template <class T>
- class Node
- {
- .. omitted..
- private:
- T* nodeObject;
- };
-
- template <class X>
- class Queue
- {
- ... omitted ...
- private:
- X* queueObject;
- };
-
- Queue<Node<int>> myQueue; // Crazy as it may seem
- // this doesn't work
-
- i.e. I want to instantiate a Queue object which holds pointers to Node
- objects which hold pointers to ints.
-
- Am I on another planet??!
-
- --
- Martin Bayly
-
- "I need a good blast! Where's the wind?"
- --------------------------------------------------------
-
-